package work;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import classa.A;

public class WorkOfFile {

	public static void main(String args[]) throws ClassNotFoundException{
		A a = new A();
		ObjectOutputStream oos;
		try
		{
		  oos = new ObjectOutputStream(new FileOutputStream("D:/WRITE.txt"));       
		  oos.writeObject(a);    
		  oos.flush();
	  	  oos.close();
		  ObjectInputStream ois = new ObjectInputStream( new FileInputStream("D:/WRITE.txt"));
		  A b;
		  b = (A) ois.readObject();
		  System.out.println(b);
		}
		catch (IOException ex)
		{
		  System.out.println(ex.toString());
		}
	}
	
}
